﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PMQLNhaHang.CustomControl;

namespace PMQLNhaHang
{
    public partial class fmQLKVBAn : Form
    {
        public fmQLKVBAn()
        {
            InitializeComponent();
        }

        private void btnThemKhuVuc_Click(object sender, EventArgs e)
        {
            fmQLKVBAnKhuVuc kv = new fmQLKVBAnKhuVuc();
            kv.ShowDialog();
        }
        private void TaoBanAn(int soluongban)
        {

        }

        private void btnThemBanAn_Click(object sender, EventArgs e)
        {
            fmQLKVBAnBanAn ba = new fmQLKVBAnBanAn();
            ba.ShowDialog();
        }
        void PhatSinhGiaoDienBanAn(int KhuVuc, int soluong)
        {
            exPictureBox temp;
            int xlocation;
            int ylocation;
            int btnHeight = 120;
            int btnWidth = 94;
            for (int i = 0; i < soluong; i++)
            {
                temp = new exPictureBox();
                xlocation = btnWidth + 40;
                ylocation = btnHeight + 40;
                temp.Location = new System.Drawing.Point(xlocation * (i % 3), ylocation * (i / 3));
                temp.Location = new System.Drawing.Point(xlocation, ylocation);
                temp.Name = "pictureBox1";
                temp.NameTable = "bàn 100";
                temp.Size = new System.Drawing.Size(btnWidth, btnHeight);
                temp.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
                temp.TabIndex = 0;
                temp.TabStop = false;
                flowLayoutPanel1.Controls.Add(temp);
            }
        }

        private void fmQLKVBAn_Load(object sender, EventArgs e)
        {
            PhatSinhGiaoDienBanAn(1, 9);
        }
    }
}
